feat(cli): ci + anonymize + diff commands#102
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds three new CLI commands for v0.3.0:
1.
ocpp-debugkit ci [dir]Run all built-in scenarios (and optional external scenario files from
[dir]), exit 0 if all pass, 1 if any fail. Supports--format jsonfor CI tooling.2.
ocpp-debugkit anonymize <file>Strip sensitive fields from a trace file. Anonymizes:
idTag,chargePointSerialNumber,stationId,transactionId, email/phone/IP patterns.3.
ocpp-debugkit diff <a> <b>Compare two trace files and output differences. Uses
diffTraces()from Issue #85.Additional Fixes
evaluateScenario()now deduplicates failure codes before comparing withexpectedFailures— fixes false negatives when a rule fires multiple times for the same codeunexpected-startscenario — extended session duration to >60s to avoid falseSUSPICIOUS_SESSION_DURATIONtriggerslow-csms-responsescenario — changed timing assertion frommaxGapMstominGapMs(the gap should be large, not small)Files Changed
packages/toolkit/src/cli/commands/ci.ts— newpackages/toolkit/src/cli/commands/anonymize.ts— newpackages/toolkit/src/cli/commands/diff.ts— newpackages/toolkit/src/cli/index.ts— register new commandspackages/toolkit/src/cli/cli.test.ts— 6 new integration testspackages/toolkit/src/core/assertions.ts— deduplicate failure codespackages/toolkit/src/scenarios/__scenarios__/slow-csms-response.ts— fix assertionpackages/toolkit/src/scenarios/__scenarios__/unexpected-start.ts— extend session duration.changeset/v03-cli-commands.md— minor bump changesetCURRENT_STATE.md— updated with v0.3.0 progressCloses #88
Checklist
ocpp-debugkit ciruns all scenarios, exits 0/1, supports--format jsonand[dir]argocpp-debugkit anonymize <file>strips sensitive fields, supports-ooutputocpp-debugkit diff <a> <b>shows trace differences, supports--format jsonCURRENT_STATE.mdupdated